/************************************************************
* @file   gkt_fpsensor.h
************************************************************/

#ifndef GKT_FPSENSOR_H
#define GKT_FPSENSOR_H

#include "gkt_types.h"

#ifdef __cplusplus
extern "C" {
#endif

/*
 * fpsensor status
 */

#define	GKT_FPSENSOR_ERROR_RESET		(1<<1)
#define	GKT_FPSENSOR_ERROR_IMG			(1<<2)

enum {
	GKT_FPS_ST_FINGER_PRESS = 0,
	GKT_FPS_ST_FINGER_LEAVE,
	GKT_FPS_ST_MAX
};

enum {
	GKT_FPS_WKUP_ST_NONE = 0,
	GKT_FPS_WKUP_ST_CHECKING,
	GKT_FPS_WKUP_ST_CERTAIN,
	GKT_FPS_WKUP_ST_MAX
};

typedef enum {
	GKT_FPS_UNINIT = 0,
	GKT_FPS_IDLE,
	GKT_FPS_DETECT,
	GKT_FPS_INTERACT,
	GKT_FPS_STOP,
	GKT_FPS_MAX
}gkt_fpsensor_status_e;

typedef enum {
	GKT_FPS_CTRL_DISABLE = 0,
	GKT_FPS_CTRL_ENABLE,
	GKT_FPS_CTRL_MAX
}gkt_fpsensor_ctrl_e;

typedef void (*gkt_fpsensor_callback_fn)(uint32_t status);

typedef struct _gkt_fpsensor_config_attr {
	gkt_fpsensor_callback_fn	callback;
} gkt_fpsensor_config_attr_s;

int gkt_fpsensor_init(void);

int gkt_fpsensor_reset(void);

uint32_t gkt_fpsensor_self_inspect(void);

int gkt_fpsensor_config(gkt_fpsensor_config_attr_s *attr);

int gkt_fpsensor_detect(void);

void gkt_fpsensor_enter_idle(void);

void *gkt_fpsensor_create_image(void);

void gkt_fpsensor_destroy_image(void *image);

int gkt_fpsensor_capture_image(void);

int gkt_fpsensor_extractfeature(uint8_t index);

int gkt_fpsensor_mergetemp(uint8_t index);

int gkt_fpsensor_savetemp(void);

int gkt_fpsensor_cleartemp(void);

int gkt_fpsensor_deletetemp(uint16_t id);

int gkt_fpsensor_identify(uint16_t *match_id);

uint8_t *gkt_fpsensor_get_image(void);

uint8_t *gkt_fpsensor_get_image_pixels(void *image);

uint32_t gkt_fpsensor_get_image_size(void *image);

void gkt_fpsensor_get_width_height(uint32_t *width,uint32_t *height);
	
uint32_t gkt_fpsensor_get_wakeup_state(void);

void gkt_fpsensor_clear_wakeup_state(void);

int gkt_fpsensor_set_enroll_mode(void);

int gkt_fpsensor_is_finger_on(void);

void gkt_fpsensor_control(gkt_fpsensor_ctrl_e control,
			uint32_t ext_data);

uint32_t gkt_fpsensor_is_err(void);

void gkt_fpsensor_lp_low_power(int when, int mode);

#ifdef __cplusplus
}
#endif

#endif	/* GKT_FPSENSOR_H */

